<?php
include 'lib_conf.php';
include 'lib/tbl_namhoa_user.php';
include 'lib/tbl_namhoa_user_score_log.php';

function make_where(&$s_Where, &$a_filterings) {    
    $s_category1 = $a_filterings['category1'    ];
    $s_category2 = $a_filterings['category2'    ];
    $s_category3 = $a_filterings['category3'    ];
    $s_category4 = $a_filterings['category4'    ];
    $s_category5 = $a_filterings['category5'    ];
    $s_category6 = $a_filterings['category6'    ];
    $s_field1    = $a_filterings['field1'       ];
    $s_keyword1  = $a_filterings['keyword1'     ];
    $s_field2    = $a_filterings['field2'       ];
    $s_keyword2  = $a_filterings['keyword2'     ];
    $s_field3    = $a_filterings['field3'       ];
    $s_keyword3  = $a_filterings['keyword3'     ];
    
    if ($s_category1 != '') { $s_Where = $s_Where . ""; }
    else                    { $s_Where = $s_Where . ""; }
    
    $v_filter = make_advanced_filter_namhoa_user($s_field1, $s_keyword1);
    
    if ($v_filter) { $s_Where = $s_Where  . ' and ' . $v_filter; }
    if ($s_Where ) { $s_Where = ' where ' . substr($s_Where, 4); }
}
?>